using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using GaiNo.WS.Core.Models;
namespace GaiNo.WS.Core.Services
{
    internal class MemberEntityBind
    {
        public static MemberEntity ReaderBind(IDataReader dataReader)
        {
            MemberEntity entity = new MemberEntity();
            object ojb;
            ojb = dataReader["UId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                entity.UId =Convert.ToInt32(ojb);
            }
			ojb = dataReader["Address"];
            if (ojb != null && ojb != DBNull.Value)
            {
                entity.Address = Convert.ToString(dataReader["Address"]);
            }
            
			ojb = dataReader["Created"];
            if (ojb != null && ojb != DBNull.Value)
            {
                entity.Created = Convert.ToDateTime(dataReader["Created"]);
            }
            
			ojb = dataReader["Grade"];
            if (ojb != null && ojb != DBNull.Value)
            {
                entity.Grade = Convert.ToInt32(dataReader["Grade"]);
            }
            
			ojb = dataReader["Mobile"];
            if (ojb != null && ojb != DBNull.Value)
            {
                entity.Mobile = Convert.ToString(dataReader["Mobile"]);
            }
            
			ojb = dataReader["Name"];
            if (ojb != null && ojb != DBNull.Value)
            {
                entity.Name = Convert.ToString(dataReader["Name"]);
            }
            
			ojb = dataReader["Password"];
            if (ojb != null && ojb != DBNull.Value)
            {
                entity.Password = Convert.ToString(dataReader["Password"]);
            }
            
			ojb = dataReader["Phone"];
            if (ojb != null && ojb != DBNull.Value)
            {
                entity.Phone = Convert.ToString(dataReader["Phone"]);
            }
            
            return entity;
        }
    }
}

